package com.lingxu.api.ztb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lingxu.api.ztb.mapper.SysUserMappers;
import com.lingxu.api.ztb.model.SysUsers;
import com.lingxu.api.ztb.service.ISysUserServices;
import com.lingxu.api.ztb.model.vo.SysUserVOs;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;


import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * 系统用户表 服务实现类
 *
 * @author admin
 * @since 2025-10-22
 */
@Slf4j
@Service
public class SysUserServicesImpls extends ServiceImpl<SysUserMappers, SysUsers>  implements ISysUserServices {

    @Resource
    private SysUserMappers sysUserMappers;

    @Transactional(readOnly = true)
    @Override
    public IPage<SysUserVOs> queryPageList(SysUserVOs query) {
        Page<SysUserVOs> page = new Page<SysUserVOs>(query.getPageNo(), query.getPageSize());
        return sysUserMappers.pageList(page,query);
    }


    @Transactional(readOnly = true)
    @Override
    public List<SysUserVOs> list(SysUserVOs query) {
        return sysUserMappers.selectSysUserList(query);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void delete(Set<String> ids) {
        if (CollectionUtils.isNotEmpty(ids)) {
            sysUserMappers.deleteBatchIds(ids);
        }
    }

}